﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class engage_interviewController : Controller
    {
        private readonly Iengage_interview he;

        public engage_interviewController(Iengage_interview he)
        {
            this.he = he;
        }

        public IActionResult engage_interview()
        {
            return View();
        }

        public IActionResult engage_interviewInser(int? id)
        {
            ViewBag.res_id = id;
            return View();
        }
        //面试登记表添加
        public async Task<int> Insert(engage_interview engage)
        {
            return await he.Insert(engage);
        }
        //简历登记表面试状态修改
        public async Task<int> Update(engage_resume engage_)
        {
            return await he.Update(engage_);
        }
        //简历查询
        public async Task<IActionResult> Query(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Query(currentPage, pageSize)));
        }
    }
}
